package
{
	import flash.display.MovieClip;
	/**
	 * ...
	 * @author Jonathan Chen
	 */
	public class DeathCount extends MovieClip
	{
		private var deathCount:Number = 0;
		private var gameState:GameState = null;
		
		public function DeathCount(gameState:GameState)
		{
			this.gameState = gameState;
		}
		
		public function AddCount(count:Number):void
		{
			deathCount += count;
			gotoAndStop(deathCount + 1);
			trace("deathcount: " + deathCount);
			if (deathCount > 4)
			{
				gameState.State = GameState.GAME_OVER_STATE;
			}
		}
		
		public function ResetCount():void
		{
			deathCount = 0;
		}
	}

}